#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'测试正则表达式'

import re

if __name__ == '__main__':
    print(re.match(r'\d{3}-\d{3,8}','012-12345')) # <_sre.SRE_Match object; span=(0, 9), match='012-12345'>
    print(re.match(r'\d{3}-\d{3,8}','012 12345')) # None

    #常见的判断方法：
    if re.match(r'\d{3}-\d{3,8}','012-12345'):
        print(True)
    else:
        print(False)


